<?php
    if(!$this->session->userdata('logged_in')) {
        redirect('logout');
    } else if($this->session->userdata('role') === 'viewer') {
        redirect('forbidden');
    }
?>
<div id="post_reject_edit_container">
    <div id="post_sidebar">
        <?php 
            if($this->session->userdata('role') === 'admin') { 
                echo anchor('post/pending/view', 'Pending('.$num_pending.')', 'id="pending_post"');
            };
            if ($this->session->userdata('role') === 'author') {
                echo anchor('post/rejected', 'Rejected('.$num_reject.')', 'id="pending_post"');
            };
            echo anchor('post/draft/'.$this->session->userdata('user_id'), 'Draft('.$num_draft.')', 'id="view_draft"');
            echo anchor('post/trash', 'Trash('.$num_trash.')', 'id="view_trash"');
            echo anchor('post/create', 'Create Post', 'id="create_post"');
         ?>
    </div>
    <div id="post_reject_edit_wrapper">
        <?php $post_id = $rejected['post_id']; ?>
        <?php echo form_open("post/rejected/edit/$post_id", array('id' => 'approve_draft_form')); ?>
            <?php echo form_label('Title: ', 'content_title'); ?>
            <?php echo form_input($rejected_title); ?><br/>
            <?php echo form_label('Summary', 'summary'); ?><br/>
            <?php echo form_textarea($summary); ?><br/>
            <?php echo form_label('Full Text', 'full_text'); ?><br/>
            <?php echo form_textarea($full_text); ?><br/>
            <input type="submit" name="submit" value="Publish" id="btn_submit" />
            <input type="button" value="Cancel" id="btn_cancel" onclick="window.location='<?php echo base_url() ?>post/pending/view'" />
        <?php echo form_close(); ?>
    </div>
</div>